<xsl:stylesheet version="1.1"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns="http://www.w3.org/2000/svg"
                xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:xlink="http://www.w3.org/1999/xlink">

    <xsl:param name="station-width"/>
    <xsl:param name="station-height"/>
    <xsl:param name="outline-width"/>
    <xsl:param name="body-fill"/>
    <xsl:param name="body-stroke"/>
    <xsl:param name="body-opacity"/>

    <xsl:output method="xml"/>

    <xsl:template match="/">

        <svg width="{$station-width}" height="{$station-height}" viewBox="0 0 {$station-width} {$station-height}">
            <xsl:variable name="doughnut-hole" select="$station-width div 2"/>
            <defs>
                <path d="
                M {$outline-width}, {$station-height div 2}
                L {$outline-width + ($station-width - $doughnut-hole) div 4}, {($station-height - $doughnut-hole div 2) div 2}
                L {($station-width - $doughnut-hole) div 2}, {$station-height div 2}"
                  stroke="{$body-stroke}"
                  stroke-width="{$outline-width}" id="arrow"
                  fill="none"/>
            </defs>
            <g transform="translate({$station-width div 2}, {$station-height div 2})">
                <animateTransform attributeName="transform" attributeType="XML"
                    type="rotate" from="0" to="-360" dur="1s"
                    additive="sum" fill="freeze"/>
                <g transform="translate({-$station-width div 2}, {-$station-height div 2})">
                    <clipPath id="doughnut">
                        <circle
                                cx="{$station-width div 2}"
                                cy="{$station-height div 2}"
                                r="{$doughnut-hole div 2}"/>

                    </clipPath>
                    <clipPath id="inv">
                        <rect x="0" y="0" width="{$station-width}" height="{$station-height}" clip-path="url(#doughnut)"/>
                    </clipPath>
                    <circle
                            cx="{$station-width div 2}"
                            cy="{$station-height div 2}"
                            r="{$station-width div 2 - $outline-width}"
                            stroke="{$body-stroke}"
                            stroke-width="{$outline-width}"
                            fill="{$body-fill}"
                            fill-opacity="{$body-opacity}"
                            clip-path="url(#inv)">
                      <animate attributeType="CSS" attributeName="fill-opacity"
                             from="{$body-opacity}" to="0" dur="0.5s" repeatCount="indefinite" />
                        <animate attributeType="CSS" attributeName="fill-opacity"
                               to="{$body-opacity}" from="0" begin="0.5s" dur="0.5s" repeatCount="indefinite" />
                    </circle>
                    <circle
                            cx="{$station-width div 2}"
                            cy="{$station-height div 2}"
                            r="{$doughnut-hole div 2}"
                            stroke="{$body-stroke}"
                            stroke-width="{$outline-width}"
                            fill="none"
                            fill-opacity="{$body-opacity}"/>
                    <use xlink:href = "#arrow"/>
                    <use xlink:href = "#arrow" transform="rotate(60, {$station-width div 2}, {$station-height div 2})"/>
                    <use xlink:href = "#arrow" transform="rotate(120, {$station-width div 2}, {$station-height div 2})"/>
                    <use xlink:href = "#arrow" transform="rotate(180, {$station-width div 2}, {$station-height div 2})"/>
                    <use xlink:href = "#arrow" transform="rotate(240, {$station-width div 2}, {$station-height div 2})"/>
                    <use xlink:href = "#arrow" transform="rotate(300, {$station-width div 2}, {$station-height div 2})"/>
                </g>
            </g>
        </svg>

    </xsl:template>


</xsl:stylesheet>